OKB Adapter: add whitelist and owner#70
Merged
doutv merged 7 commits intoreview/cgt-contractfrom Oct 17, 2025
Merged
Conversation
- Removed the OKBBurner implementation and its related functionality from DepositedOKBAdapter, simplifying the contract. - Added a new ERC20Rescuer contract to handle the rescue of ERC20 tokens, enhancing token management. - Updated DepositedOKBAdapter to utilize the new rescuer address for transferring any mistakenly sent OKB tokens. - Cleaned up unnecessary events and errors related to the burner functionality, improving code clarity and maintainability.
…ntrol - Introduced Ownable inheritance to manage ownership and access control. - Added a whitelist mechanism allowing only approved addresses to deposit OKB. - Implemented batch functions for adding and removing addresses from the whitelist. - Updated deposit logic to enforce whitelisting and added error handling for zero addresses. - Removed the ERC20Rescuer contract, consolidating rescue functionality within DepositedOKBAdapter. - Cleaned up unnecessary errors and improved overall contract clarity and maintainability.
- Introduced a new error for transfer failures to improve error handling. - Updated the constructor to transfer ownership to the specified owner after minting. - Modified transfer functions to check for successful token transfers, reverting on failure. - Improved overall contract robustness and clarity by handling potential transfer issues.
- Simplified the TransferNotAllowed error by removing parameters, enhancing clarity. - Updated transfer functions to always revert with the new error format, ensuring consistent error handling. - Improved code maintainability by reducing complexity in transfer logic.
- Introduced a new test suite for DepositedOKBAdapter, covering constructor validation, whitelist management, deposit functionality, transfer restrictions, and ERC20 rescue operations. - Implemented mock contracts for testing, including MockOKB and MockOptimismPortal2, to simulate interactions and validate behavior. - Enhanced test coverage to ensure robust error handling and correct functionality across various scenarios, including deposits by whitelisted users and handling of edge cases. - Improved overall test structure for better maintainability and clarity.
- Eliminated the OKBBurner contract from the SetupCustomGasToken script, simplifying the deployment process. - Updated the DepositedOKBAdapter deployment to handle OKB burning internally and added the deployer address to the whitelist. - Enhanced configuration checks to verify adapter ownership and whitelist status, ensuring robust contract setup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.